package cn.tedu.xuecha.controller;

import cn.tedu.xuecha.entity.dto.MenuDTO;
import cn.tedu.xuecha.respone.JsonResult;
import cn.tedu.xuecha.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author coinyang
 * @date 2023/4/22 12:47
 */
@Api(tags = "菜单管理")
@RestController
@RequestMapping("menu")
public class MenuController {
    @Autowired
    MenuService menuService;

    @ApiOperation("添加菜单")
    @PostMapping("/addNewMenu")
    public JsonResult addNewMenu(MenuDTO menuDTO){
        menuService.addNewMenu(menuDTO);
        return JsonResult.ok();
    }
}
